import request from "@/utils/request";
//加入购物车
export const addToCart = ({ skuId, count }) => {
  return request({
    url: "/member/cart",
    method: "POST",
    data: {
      skuId, //商品sku的id
      count, //商品数量
    },
  });
};
//获取最新购物车列表
export const getNewCartList = () => {
  return request({
    url: "/member/cart",
  });
};
//删除购物车 参数数组形式
export const delShoppingCart = (ids) => {
  return request({
    url: "/member/cart",
    method: "DELETE",
    data: {
      ids,
    },
  });
};

//合并购物车 参数数组形式
export const MergeShoppingCart = (data) => {
  return request({
    url: "/member/cart/merge",
    method: "POST",
    data,
  });
};
